<template>
  <div class="layout">
    <div style="display: flex; justify-content: center">
      <Breadcrumb class="breadcrumb" :crumbs="crumbs"></Breadcrumb>
    </div>

    <div class="entrprise_list">
      <div class="left_list">
        <div class="service" v-show="detailedData.appealTypeName != null">
          <p class="tips">{{detailedData.appealTypeName}}</p>
        </div>
        <div class="title_Subject">
          <span>{{detailedData.title}}</span>
        </div>
        <div class="time_Browse">
          <span style="margin-right: 20px;">发文日期：{{detailedData.createTime}}</span>
          <span>阅读浏览：{{detailedData.viewNumbers}}次</span>
        </div>
        <div class="content" v-text="detailedData.appealContent"></div>
      </div>
      <div class="right_list">
        <ContainerTitle text="需求广场" :more="true" @jump="$router.push('/serviceDemandSquare')"></ContainerTitle>
        <Rement :list="rementList"></Rement>
      </div>
    </div>
  </div>
</template>
<script>
import Breadcrumb from '@/components/breadcrumb'
import Rement from './/components/rement'
import { getqserviceRequirement, onDetailed } from "@/common/api/service.js";
export default {
  components: { Breadcrumb, Rement },
  data() {
    return {
      crumbs: [
        {
          label: '门户首页',
          value: 'index',
        },
        {
          label: '服务市场',
          value: 'service',
        },
        {
          label: '需求广场',
          value: 'serviceDemandSquare',
        },
        {
          label: '需求广场详情',
          value: '',
          choose: true,
        },
      ],
      rementList: [],
      detailedData: '',
      dataList: '',
    }
  },
  methods: {
    //进入需求广场详情
    onGetInto(item) {
      if (item != '') {
        localStorage.setItem('DETAILS', JSON.stringify(item))
      }
      // console.log(item, '参数')
      // this.$router.push('demandDetails')
      this.onDetailed()
      this.getqserviceRequirement()
    },
    //详情数据
    async onDetailed() {
      this.dataList = JSON.parse(localStorage.getItem('DETAILS'))
      let res = await onDetailed(this.dataList.id)

      if (res.status == 200) {
        this.detailedData = res.result
        
      }
    },
    // 服务需求列表
    async getqserviceRequirement() {
      let obj = {
        pageNum: 1,
        pageSize: 3,
      }
      let res = await getqserviceRequirement(obj)
      console.log('res123', res)
      if (res.status == 200) {
        this.rementList = res.result.records
      }
    },
  },
  created() {
    this.onDetailed()
    this.getqserviceRequirement()
  },
}
</script>
<style lang="scss" scoped>
.breadcrumb {
  width: 1200px;
  margin: 20px 0;
}
.layout {
  min-height: 100vh;
  position: relative;
  padding-bottom: 150px;
  // box-sizing: border-box;
}
.two_text {
  word-break: break-all;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.entrprise_list {
  display: flex;
  justify-content: center;
  margin-bottom: 120px;
  .left_list {
    // margin: 0 auto;
    width: 900px;
    .tips {
      background-color: #f7f1eb;
      padding: 3px 10px;
      color: #f09450;
      font-size: 12px;
      background: #f7f1eb;
    }
  }
  .right_list {
    width: 300px;
    .more {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 2px solid #045db9;
      padding-bottom: 20px;
      margin-bottom: 25px;
      .demand_Square {
        // width: 129px;
        // height: 40px;
        font-family: MicrosoftYaHei;
        font-size: 20px;
        color: #045db9;

        font-weight: 400;
      }
      .added {
        // width: 83px;
        // height: 33px;
        font-family: MicrosoftYaHei;
        font-size: 14px;
        color: #333333;
        text-align: right;

        font-weight: 400;
      }
    }
    .list_Data {
      width: 300px;
      height: 190px;
      border: 1px solid #eeeeee;
      margin-bottom: 20px;
      padding-top: 15px;
      .label {
        width: 92px;
        height: 32px;
        background: #f7f1eb;
        .label_Service {
          height: 30px;
          font-family: SourceHanSansSC-Medium;
          font-size: 12px;
          color: #f09450;
          font-weight: 500;
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }

      .Details {
        margin: 10px 15px;
        text-align: left;
        .titleName {
          width: 268px;
          font-size: 17px;
          font-weight: 700;
          margin-bottom: 5px;
          word-wrap: break-word;
        }
        .describe {
        }
        .look_At_Time {
          .date_surface {
          }
          .time_surface {
          }
        }
      }
    }
    // margin-left: auto;
  }
  .service {
    // width: 11%;
    border-radius: 3px;
    margin-bottom: 12px;
    display: flex;
    .written_words {
      width: 50px;
      height: 11px;
      font-family: SourceHanSansSC-Medium;
      font-size: 12px;
      color: #f09450;
      text-align: center;
      font-weight: 500;
    }
  }
}
.title_Subject {
  // height: 28px;
  display: flex;
  font-family: SourceHanSansSC-Bold;
  font-size: 20px;
  color: #333333;
  font-weight: 700;
  margin-bottom: 10px;
  word-break: break-all;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  width: 826px;
  text-align: left;
}
.time_Browse {
  display: flex;
  height: 16px;
  font-family: SourceHanSansSC-Normal;
  font-size: 12px;
  color: #999999;
  font-weight: 400;
  margin-bottom: 10px;
}
.content {
  width: 862px;
  text-align: left;
  font-family: SourceHanSansSC-Normal;
  font-size: 14px;
  color: #333333;
  font-weight: 400;
  word-wrap: break-word;
  margin-top: 25px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>